<?php
/**
 * @copyright Copyright (c) 2020 cleverstone
 */

/************************************ 正则定义 *******************************************/
// 手机号正则
defined('MOBILE_REGEX') or define('MOBILE_REGEX', '/^1((3|4|5|6|7|8|9){1}\d{1})\d{8}$/');
// 邮箱正则
defined('EMAIL_REGEX') or define('EMAIL_REGEX', '/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/');
// 身份证号正则
defined('ID_CARD_REGEX') or define('ID_CARD_REGEX', '/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/');
// IP正则
defined('IP_REGEX') or define('IP_REGEX', '/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/');
// URL正则
defined('URL_REGEX') or define('URL_REGEX', '/^http[s]?:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/');